﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>Untitled Document</title>
        <script type="text/javascript" src="../../js/jquery/jquery.js">
        </script>
        <script type="text/javascript" src="../../js/jquery/jquery-migrate.js"> 
        </script>
        <script type="text/javascript" src="../../js/jqueryui/jquery-ui.js">
        </script>
        <script type="text/javascript" src="../../js/ctp/public/ctp.core.js">
        </script>	
        <script type='text/javascript' src='../../js/ctp/public/ctp.base.js'></script>
        <script type='text/javascript' src='../../js/ctp/public/ctp.ui.component.js'></script>
        <script type="text/javascript" src="../../js/ctp/panel/ctp.ui.panel.js">
        </script>
        <script type="text/javascript" src="../../js/ctp/button/ctp.ui.button.js">
        </script>
        <script type="text/javascript" src="../../js/ctp/public/jsextend.js">
        </script>
		<script type="text/javascript" src="../../js/ctp/groupbox/ctp.ui.groupbox.js">
		</script>
		<script type="text/javascript" src="../../js/ctp/gridlayout/ctp.ui.gridlayout.js">
        </script>		
  <script type="text/javascript" src="../../js/ctp/messagebox/ctp.ui.messagebox.js"></script>        

		<link href="../../css/skins/standard/ctp-common.css" rel="stylesheet" type="text/css"/>
		<link href="../../css/panel.css" rel="stylesheet" type="text/css"/>
        <link href="../../css/button.css" rel="stylesheet" type="text/css"/>
		<link href="../../css/groupbox.css" rel="stylesheet" type="text/css"/>
		<link href="../../css/gridlayout.css" rel="stylesheet" type="text/css"/>
		<link href="../../css/messagebox.css" rel="stylesheet" type="text/css"/>
	
        <script>          
            $(document).ready(function(){ 			                 
				var button1 = new ctp.ui.button({
                    id: 'button1',
                    text: '接收父页面数据',
                    width: '100%',
                    onClick:fn1,
                    disabled: false                
                });
                var button2 = new ctp.ui.button({
                    id: 'button2',
                    text: '传递父页面数据',
		                onClick:fn2,
                    width: '100%',
                    disabled: false           
                });
               
				var button3 = new ctp.ui.button({
                    id: 'button3',
                    text: '接收父页面数据2',
                    width: '100%',
                    onClick:fn3,
                    disabled: false                
                });
                
				var buttonsLayout = new ctp.ui.gridlayout({
					id:'buttonsLayout',
                    width: '98%',
                    cols: 3,
                    align: 'center',
                    colSpace: 30,
                    items: [
					     [{element: button1},{element: button2},{element: button3}]
					]
                
                }); 
				var buttonsGroupbox=new ctp.ui.groupbox({
			  	    id: 'buttonsGroupbox',						
					items:[buttonsLayout],
					width:'100%',
					title:'功能测试区'						   
			     });
				new ctp.ui.panel({
                    title: 'panel',
                    collapsible: true,
                    width: '550px',
                    height: 'auto',
					align:'center',
					items:[buttonsGroupbox],
                    renderTo: 'body'
                });            
            });
             
    function fn1(){
    	ctpMSB.alert({title:'再弹',message:'取主页面数据:'+ $('#hideValue',$(parent.document)).html()});
    }          
               
    function fn2(){    	
		          var retObj = {};
             retObj.flag = "do";
             retObj.data = "456";
             parent.ctpMSB.doHandler(retObj,true);//调用父页面设定的回调函数并传值retObj ,true表示自动关闭窗口
    }                  

    function fn3(){    	
     	    	ctpMSB.alert({title:'再弹',message:'取主页面数据主动传递数据:'+ parent.ctpMSB.settings.param});
    }     
                
        </script>
    </head>
    <BODY>
        <b>弹出框实例</b>
        <hr/>
        <br/>  
    </BODY>
</html>
